home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / VideoToolbox / Video synch < prev   
Encoding:
Text File  |  1995-11-08  |  56.7 KB  |  893 lines  |  [TEXT/R*ch]

  1. VideoToolbox: Video synch
  2. November 8, 1995
  3.  
  4. WHAT'S NEW:
  5. •Surprise: 7500/100 video is MUCH faster than 9500/120--see table below.
  6. •Update on our request to Apple for support of high frame rates--see HIGH FRAME
  7. RATES.
  8. •"Video bugs" has been appended to the end of this document.
  9.  
  10. The VideoToolbox allows you to produce accurately controlled visual stimuli. This
  11. document deals with time; how to make sure each video frame shows what you want.
  12. After reading this document, you'll probably want to look at the accompanying
  13. "Video bugs" document, and run the "TimeVideo" program on your Mac, to give all
  14. your video cards a thorough workout and learn their timing characteristics. If
  15. you have many computers, put TimeVideo on a floppy and run it from the floppy on
  16. each machine; all the results will accumulate in a single report file. I am
  17. always glad to receive copies of the TimeVideo report on new machines.
  18.  
  19. MOVIES. It's easy to show movies on a Mac. Create all your GWorlds in memory
  20. ahead of time, and then call CopyWindows() to copy one image after another to the
  21. screen (e.g. try the demos NoiseVBL or SandStorm). For any serious application
  22. you'll want a real-time movie, one image per video frame, so you'll want to wait
  23. for a new frame before copying each image, using one of the synchronization
  24. techniques described below (e.g. try the demo NoiseVBL). (Incidentally, some
  25. people have mistakenly assumed that page switching is the ONLY way to achieve a
  26. real-time movie. It's not. Video cards serially read the image pixels one by one
  27. during most of the frame period, e.g. 15 ms. If your computer starts writing at
  28. the beginning of the new frame and writes the pixels faster than they're read
  29. you'll display a whole new image on each frame.) How big a movie you can show in
  30. real time will depend on how fast your processor is. TimeVideo does this timing
  31. for you, telling you what fraction of the screen you can fill with a real-time
  32. movie. If you can't do a full-screen movie and you need to show multiple patches,
  33. consider showing several small movies, updating only the dynamic parts of the
  34. screen. (We assume that you are not limited by memory, and therefore do not
  35. discuss Apple's QuickTime, whose principal purpose, beyond making movies
  36. portable, is to minimize storage requirements by using image compression.) Most
  37. Macs access built-in video much more quickly than NuBus video. Here are data
  38. rates for showing movies on a few machines:
  39.     
  40. Power Mac 7500/100: Built-in 36 MB/s
  41. Power Mac 7200/90 with 2 MB VRAM: Built-in 33 MB/s
  42. Power Mac 7200/90 (with standard 1 MB VRAM): Built-in 25 MB/s
  43. Power Mac 7200/75 (with standard 1 MB VRAM): Built-in 25 MB/s
  44. Power Mac 8500/120: Built-in 25 MB/s, ATI PCI card 17 MB/s
  45. Power Mac 9500/120: ATI PCI card 17 MB/s, Radius Thunder 30/1600 PCI card 4 MB/s
  46. Power Mac 8100/80: Built-in VRAM 18 MB/s, DRAM 17 MB/s, "Built-in AV" 15 MB/s
  47. Power Mac 7100/66 (w AV,secondary cache): Built-In VRAM 17 MB/s, DRAM 13 MB/s.
  48. Workgroup Server 6150/66: Built-In DRAM 16 MB/s.
  49. Power Mac 6100/60AV (w secondary cache): Built-in VRAM 12 MB/s, DRAM 15 MB/s
  50. Quadra 840av: Built-in 12 MB/s, NuBus 9 MB/s
  51. Quadra 630: Built-in 12 MB/s
  52. Quadra 950: Built-in 11 MB/s, NuBus 5 MB/s
  53. LC 475: Built-in 10.6 MB/s
  54. Centris 660AV: Built-in 10.2 MB/s
  55. Quadra 660AV: Built-in 9.6 MB/s
  56. Quadra 900: Built-in 9.5 MB/s, NuBus 5.5 MB/s
  57. Centris 610: Built-in 9 MB/s
  58. Centris 650: Built-in  5.8  MB/s     
  59. LC III: Built-in  5.8  MB/s     
  60. IIci: Built-in 5.5 MB/s, NuBus 3.7 MB/s
  61. II with Rocket 68040 accelerator: NuBus 4.0 MB/s
  62. PowerBook 520/540: 3.6 MB/s
  63. IIfx: NuBus 3.0 MB/s (8•24GC "acceleration" reduces it 1.5 MB/s)
  64. PowerBook 160: Built-in LCD screen and video port 3.0 MB/s
  65. IIcx: NuBus 2.7 MB/s
  66. II: NuBus 2.7 MB/s
  67. LC II: Built-in  2  MB/s     
  68. PowerBook 170: Built-in LCD screen 1.6 MB/s, SCSI Radius PowerView 1 MB/s
  69. Classic: Built-in 1.7 MB/s
  70. Classic II:  Built-in 1.4 MB/s
  71. SE: Built-in 0.9 MB/s
  72. Plus: Built-in 0.6 MB/s
  73. The quoted rate is the best, across all pixel depths and across CopyBits and
  74. CopyBitsQuickly, which are usually within +/-20% of each other. CopyBits, being
  75. part of QuickDraw, always runs native. 
  76.  
  77. I haven't got my own PCI Mac yet (got four 7500's on order), but Mal Semple and
  78. Dan Sanes lent me their 8500 and 7500 for a few days and several people have
  79. sent me TimeVideo reports on the PCI Macs. The first four lines in the table
  80. above were a big surprise to me. CopyBits is slowest on the 9500, faster on the
  81. 7200 and 8500, and yet faster on the 7500. This is confirmed by an engineer at
  82. Apple, "Yes, this actually does make sense: The 7500 and 8500's internal video is
  83. on a private PCI bus that runs synchronous with the processor bus. Thus, on the
  84. 7500 it's running at 50 MHz and on the 8500 it's running at 40 MHz. The 9500's
  85. video is on a regular PCI bus that runs at 33 MHz."
  86.  
  87. The just-released PowerMac 7200 and 7500 are very appealing. (The 8500 and 9500
  88. seem overpriced.) All the PCI Macs have two busses: the PCI bus always runs at a
  89. fixed 33 1/3 MHz; the processor bus runs from 40 to 50 MHz, depending on the
  90. model or CPU card (Noah Price, noah@apple.com). The 7200 is quite similar to the
  91. 7500, having lower clock rate, lower internal SCSI speed, and non-upgradable
  92. soldered-in processor chip. The functional difference between the 7500 and the
  93. 8500 seems to be just the processor, processor-bus speed, and L2 cache (7500/100
  94. has 601 running at 100 MHz, 50 MHz internal bus, and L2 cache is optional;
  95. 8500/120 has 604 running at 120 MHz, 40 MHz internal bus, and L2 cache is
  96. included). MacWeek reported that moving the 604 daughterboard and the L2 cache
  97. from an 8500 to a 7500 yielded the same performance. All the reviewers love the
  98. case of the 7200 and 7500 (easy to access internals) and hate the 8500 minitower
  99. case (requires extensive disassembly to add memory). Based on the those specs, I
  100. think the best buy would be the 7200--add an L2 cache for more video
  101. speed--closely followed by the 7500, with the 8500 seeming to be a lot more money
  102. for very little more in performance. However, the benchmarks below reveal that
  103. the 7500 video speed is significantly higher than all other Macs, presumably
  104. because of its 50 MHz internal bus. Furthermore, an Apple engineer has offered to
  105. produce custom versions of the 7500/8500 video driver to support high monitor
  106. frame rates. I will share these with users of the VideoToolbox. Wanting to use
  107. these custom drivers restricts me to just those two models, 7500 and 8500. I've
  108. ordered four 7500's. I may upgrade to the 604 processor in the future, when it's
  109. cheaper.
  110.  
  111. Ken Alexander, kennalex@uic.edu, reported, and it's confirmed by Apple, that
  112. the video driver on the 7500 and 8500 supresses the VBL interrupt while it's
  113. loading the CLUT, so any VBL-interrupt-based task (e.g. a frame counter) will
  114. miss a frame each time you call cscSetEntries to load the clut. Calling
  115. cscSetEntries once per frame to synchronize your code with the display should
  116. work fine, but it'll be slightly tricky to check for overrun (i.e. trying to do
  117. too much between cscSetEntries calls), since a simple VBL-interrupt-based frame
  118. counter will run differently on different Macs. I've just received
  119. documentation on extra video driver calls, supported only by this driver, that
  120. disable the interrupt suppression. See "7500/8500 driver.doc".
  121.  
  122. MacWeek 10/9/95 page 42 said that the powermac 7200's video speeds up with more
  123. vram. As indicated in the table above, Tom Busey tried adding 1 MB of VRAM
  124. (costing $85) to the standard 1 MB on his 7200/90, and found a 33% increase of
  125. CopyBits speed.
  126.  
  127. Power Mac 7100 NuBus bug: Michael Eckert (meckert@ee.uts.edu.au) writes, "From
  128. what I understand, a bug in the 7100's NuBus interface chip limits the throughput
  129. of the NuBus port. This does not affect built-in VRAM video or DRAM video (the AV
  130. option, in PDS slot). This bug affects only the 7100 (not 8100), and is supposed
  131. to be fixed during the next release of the machines." October 12, 1994.
  132.  
  133. SPRITES. If you want to show objects moving around the screen, and your
  134. computer isn't fast enough to do a full screen movie, then you may want to
  135. animate just the objects. Objects animated in this way are called "sprites".
  136. Tony Myles has published a package called "SpriteWorld" that you may want to
  137. download from info-mac/Development. (For an explanation of how to do that, read
  138. the VideoToolbox "Advice" document.)
  139.  
  140. PAGE SWITCHING. Many video cards have multiple video pages; check your
  141. TimeVideo report, or call GDGetPageCnt(). Normally the Macintosh only uses page
  142. 0, but if you have multiple pages, they can be switched by calling
  143. GDSetPageShown() and GDSetPageDrawn(). This could be used to show very short
  144. full-screen movies, e.g. alternating two images. This might be an effective way
  145. to show large slow movies, taking several frames to load each new image to an
  146. unseen page that's instantly swapped in when it's full.  (The number of pages
  147. available depends on the pixel size. In max depth there's always only one page.
  148. In lesser depths there's unused memory, which the video driver may make available
  149. as extra pages.) Sergei A.Kurkin, Kurkin@med.hokudai.ac.jp, has "tested
  150. GDSetPageDrawn() and GDSetPageShown(), and they seem to work OK."
  151.  
  152. CLUT (Color Lookup Table) ANIMATION. Most video cards have a hardware color
  153. lookup table (clut) that dynamically transforms each pixel to a color (an RGB
  154. triplet) that is sent to the digital to analog converters. Temporal modulation
  155. (e.g. flicker or fading on and off) of visual stimuli can be achieved very
  156. conveniently by loading a new clut on each frame. Look at the demo
  157. FlickeringGrating. However, not all video card drivers are fast enough to
  158. achieve this. (Usually this is not a hardware limitation; it's crumby driver
  159. software.) Run TimeVideo to find out for sure; it determines how many frames it
  160. takes either GDSetEntries or SetEntriesQuickly to load the clut. The clut is
  161. also used for gamma correction. Apple's provision for gamma correction is
  162. somewhat crude; for the utmost luminance accuracy you may wish to use the
  163. Luminance.c routines. See section B, below.
  164.  
  165. COLOR CYCLING. Bart Farell, Bart_Farell@isr.syr.edu, writes, "It's easy to do
  166. color cycling using either GDSetEntries or SetEntriesQuickly, e.g.
  167.     GDSetEntries(device,start,count,table+offset);
  168. First create a double-sized ColorSpec array, e.g., an array of 512 instead of
  169. 256. It's called "table" in the above example. Set up the second half of the
  170. array to be identical to the first half, to implement wrap-around.
  171. GDSetEntries/SetEntriesQuickly(), as always, loads “count+1” entries starting at
  172. entry “start”. (Yes, “count+1”, that’s Apple’s confusing convention.)  Just add
  173. an integer "offset" to the table pointer. GDSetEntries/SetEntriesQuickly() will
  174. start reading the table, offset by that number of ColorSpecs. Across a sequence
  175. of frames, using a different offset for each call to GDSetEntries or
  176. SetEntriesQuickly(), each ColorSpec of the array can be loaded to any entry. In
  177. practice you'd create several of these double-sized ColorSpec arrays and animate
  178. by using a different array and offset on each frame.  The payoff is that the
  179. number of arrays, and clut computation time, is an order of magnitude lower than
  180. would be required to compute a custom clut for each case."
  181.  
  182. MAKING DYNAMIC WHITE NOISE. I know of at least three people (including myself)
  183. that hit upon clut animation as a fast way to synthesize dynamic white noise.
  184. You fill the image plane with random numbers in the range 0 to 255, and you
  185. load a new random clut on each frame. It might seem that this will produce noise
  186. that is spatially and temporally uncorrelated. Not quite. Any pair of pixels has
  187. a 1/256 chance of being driven by the same clut entry, in which case they will be
  188. perfectly correlated. So the spatial autocorrelation function has the (desired)
  189. delta function at zero separation and an (undesired) 1/256 correlation at all
  190. other separations. This corresponds to the desired flat spectrum, PLUS an
  191. undesired delta function at zero spatial frequency. In plain English, you'll end
  192. up with dynamic white noise plus a spatially-uniform temporally-white flicker.
  193. (This problem does not arise if you only use each clut entry once, but that
  194. restricts you to an image of only 16x16.) Note that I am only discussing first
  195. and second order statistics. Higher-order statistics will still differ from truly
  196. white noise, but I doubt that our visual systems are sensitive to the difference.
  197. However, the spatially uniform flicker component of the clut animation noise is
  198. visually very salient. Ted Adelson noticed it immediately when I proudly
  199. demonstrated this method at Optical Society in San Francisco in 1989 (I think).
  200. The artifactual flicker becomes progressively more salient as you increase the
  201. viewing distance, since the spatially uncorrelated noise fades out while the
  202. spatially uniform noise is unaffected. What I now do, and recommend to others, is
  203. to use brute force. Precompute all the noise and show a movie in which all the
  204. pixels are truly independent random samples. The VideoToolbox routine RandFill()
  205. is a fast way to compute the noise, and is used by NoiseFill.c. Try the demos
  206. Sandstorm and NoiseVBL.
  207.  
  208. FANCIER TRICKS. The video card has only one clut, but it is possible to
  209. simultaneously present multiple independently modulated patterns, by reserving
  210. separate sections of the clut for each temporal modulation, though you'll
  211. suffer a comensurate loss of intensity resolution. Clut animation is not
  212. restricted to dynamic modulation of contrast. If the pixel values represent
  213. phase, and the clut is loaded with a sin function, then rotating the clut
  214. entries--i.e. setting the i-th entry to what was formerly the value of the i-1
  215. entry (see Color Cycling, above)--will shift the phase of the pattern. A
  216. spatially vignetted drifting grating may be synthesized by using alternate pixels
  217. (or frames) to represent vignetted sin and cos components of the pattern,
  218. devoting half the clut to each (or loading alternate cluts on alternate frames).
  219. Appropriate adjustment of the relative contrasts of the sin and cos components
  220. will produce any desired phase of the sum. However, most of these tricks are
  221. superfluous; it’s usually easier and better to just show a movie. Many current
  222. processors are fast enough to show 8-bit full-screen movies.
  223.  
  224. A. HOW TO SYNCHRONIZE A MACINTOSH PROGRAM TO A VIDEO CARD.
  225.  
  226. The hardest part in doing vision experiments is synchronizing the computer
  227. program to the video card. Nearly all video cards are masters, and run freely,
  228. expecting the video monitor to be a slave. Any experiment that cares about
  229. timing will normally have to synchronize itself to the video card, by waiting
  230. for each frame to end, as will be discussed below.
  231.  
  232. You typically can't access the video card hardware directly, because it's
  233. undocumented. Instead you are allowed to send requests to the video driver
  234. associated with your video card. All video cards that plug into the Mac come
  235. with video drivers that conform sufficiently well to the Apple guidelines that
  236. they are at least minimally compatible with the VideoToolbox. However, some
  237. drivers have outright bugs, and the timing of many drivers, for which Apple
  238. does not publish guidelines, sometimes makes it surprisingly difficult to do
  239. simple things. A current list of these bugs and "features" appears in the
  240. VideoToolbox "Video driver bugs" document.
  241.  
  242. Every video card has a video driver in its ROM, but the manufacturer may supply
  243. a newer driver by floppy that supercedes the one in ROM, which may be buggy.
  244. (Built-in video devices, e.g. in the Mac IIci and Quadra computers, load the
  245. video driver from the computer's ROM.) Apple distributes video driver updates
  246. as resources in the System file, so updating your System may change the video
  247. driver of your Apple video card. IdentifyVideo(device) returns a string with the
  248. name and version number of the driver that is actually in use. Try TimeVideo.
  249.  
  250. There are three different ways to synchronize a program to a video card, which
  251. we'll first describe quickly, and then more fully. (1) Apple recommends using
  252. the vertical blanking interrupts, which are supposed to occur once per frame,
  253. at the beginning of the vertical blanking. The VideoToolbox VBLInstall.c routines
  254. make this very easy to do. A disadvantage of this approach is that it fails if
  255. you raise the processor priority to block all interrupts. (2) Most (not all)
  256. video drivers, when asked to load the clut, wait until the vertical blanking
  257. interval before beginning to load the clut. (They wait in order to avoid creating
  258. visible hash on the screen while the clut is changing.) This has the side effect
  259. of synchronizing your program to the display, since the driver doesn't return
  260. control until the VBL interval occurs. Either of these synchronization methods (1
  261. or 2) may fail, depending on which video card you have, what you've set the pixel
  262. size to (1 to 32 bits), and whether you've raised the processor priority. The
  263. demo program TimeVideo tests both methods of synchronization on all your video
  264. cards at all pixel sizes and saves the results in a text file. (3) I think that
  265. all video cards provide a read-only vertical-blanking bit, but unfortunately few
  266. manufacturers will tell you its address, so you have to find it yourself
  267. (typically by disassembling the video driver), which is tedious.
  268.  
  269. 1. VBL Interrupts. Most video cards emit one VBL interrupt during each video
  270. frame. However, during 1990-1 Apple generated some poor video drivers for their
  271. cards ("Macintosh Display Card": 8•24)  and the built-in video in the Quadra 700
  272. and 950. These drivers generate several interrupts per frame. (Kyle Cave
  273. discovered that there are no extra interrupts if the cache is disabled on the
  274. Quadra 700.) This behavior is contrary to Apple's documentation, but VBLInstall.c
  275. works around the bug, using a timer to discard the excess interrupts (as
  276. suggested by Raynald Comtois). Some video drivers take multiple frames to load
  277. the clut, and block interrupts while doing so, wreaking havoc with any attempt to
  278. count frames. Apple's video drivers produced before 1990 and since 1992 seem to
  279. be ok. (This may be in response to my many bug reports.) Try the demos TimeVideo
  280. and NoiseVBL.
  281.      The best current theory (due to Raynald Comtois) on the source of the
  282. extra interrupts is that the card is asserting the interrupt line for a fixed
  283. duration, perhaps 1 ms. As long as you are in the interrupt-handling routine (or
  284. one of higher priority), other interrupts of the same level are disabled. If you
  285. stay in the interrupt routine for long enough, the interrupt line has time to be
  286. released and you don't get a second interrupt, otherwise you do.
  287.  
  288. 2. LOADING THE CLUT. It seems that all video drivers automatically synchronize
  289. clut-loading to the video frame. Apple's guidelines for video drivers (in the
  290. book Designing Cards and Drivers) state that the video driver may save the
  291. clut-load (i.e. cscSetEntries) request and defer the actual loading until the
  292. next VBL interrupt. Such video drivers return almost immediately after a
  293. cscSetEntries request. Thus, although the actual clut load will be synchronized to
  294. the display, your program will be asynchronous because the GDSetEntries call will
  295. return immediately. However, Apple's guidelines state that if the processor's
  296. interrupt priority has been raised, suspending the video card's VBL interrupts,
  297. then the video driver should always load the clut before returning, which would
  298. synchronize your program to the display. You can raise and lower the processor
  299. priority by calling the VideoToolbox routine SetPriority.c. The priority is
  300. normally zero. TimeVideo measures timing at both normal and high psiority.
  301.      Be aware that a cscSetEntries request, i.e. calling GDSetEntries(), does not
  302. necessarily wait for the beginning of the next vertical blanking interval. It
  303. might merely wait until blanking is true. As a result, two successive GDSetEntries
  304. calls might occur during the same blanking interval. To get exactly one call per
  305. frame you may need to delay for a suitable interval (perhaps 1 ms) before calling
  306. it again.
  307.      Most video drivers that I've tested seem to be synchronous and reliably
  308. take exactly one frame to load the clut. However, some video drivers take
  309. longer, e.g. any loading of the clut on Apple's new video cards ("Macintosh
  310. Display Card": 8•24) takes 30 ms--two frames--which is unacceptably slow for
  311. lookup table animation. The TrueVision NuVista seems to be asynchronous.
  312. Presumably the on-board processor accepts the clut information at any time and
  313. actually updates the clut during the next vertical blanking interval. However,
  314. this means that asking the video driver to load the clut doesn't have the
  315. useful side effect of synchronizing the Mac program to the display. The NuVista
  316. takes about 0.3 frames (i.e. a few ms) to reload the whole clut when in 8, 16, or
  317. 32-bit mode, but takes several frames (i.e. tens of ms) when in 1, 2, or 4-bit
  318. mode (presumably because the fractional byte addressing is slow). I haven't
  319. checked, but presumably the NuVista driver would become synchronous, as specified
  320. by Apple, if the processor priority were raised.
  321.      SetEntriesQuickly.c--written primarily by Raynald Comtois, Peter Lennie,
  322. and Bill Haake--provides fast clut loading for several popular video devices. Try
  323. TimeVideo.
  324.      If 8-bit pixels are enough, and you have a NuBus, consider buying Apple's 
  325. old "Toby" or "TFB" video cards, since they work fine, and cost only $90 each
  326. from Shreve Systems (800)-227-3971.
  327.  
  328. 3. BLANKING BIT. Apparently all video cards have a blanking bit (telling
  329. whether the video signal is in the blank period between frames), but, alas, the
  330. manufacturers never tell you where it is. You could figure out which bit by
  331. disassembling the driver, as I did for the Apple Toby and TFB video cards (no
  332. longer sold by Apple; call Shreve at phone  number given above). Perhaps one
  333. could write a program that would find the VBL bit automatically, by looking for
  334. any bit that changes at the right frequency.
  335.      WaitForBlanking() in SetEntriesQuickly.c tests the blanking bit, but
  336. presently supports only the (obsolete) Toby and TFB video cards. Hopefully other
  337. people will enhance this routine to support more devices.
  338.  
  339. 4. CONCLUSION. Don't take synchronization or lookup table animation for granted.
  340. Run TimeVideo to check out your video cards.
  341.  
  342. B. SYNCHING MULTIPLE VIDEO CARDS TO EACH OTHER
  343.  
  344. SOFTWARE: Short of butchering the hardware, synching two video cards is hard to
  345. do. It needn't be so, if the manufacturers were more forthcoming about how to
  346. program their cards. By disassembling the video driver for Apple's original
  347. "Toby" video cards I worked out that there are halt and restart commands that can
  348. be issued to the card. Several video cards can be synched by restarting them all
  349. at once (actually one after the other, in quick succession). Their quartz
  350. crystals run at slightly different frequencies so the cards slowly drift out of
  351. phase with each other, but that's still good enough for a relatively brief visual
  352. stimulus, resynching before each stimulus. Software to do this for the Toby video
  353. cards (which are still available from Shreve Systems (800)-227-3971, $90 each) is
  354. in the VideoTFB.c file in the VideoToolbox. It seems very likely that this
  355. approach is applicable to most video cards, but you would need to discover what
  356. the appropriate commands are to restart your cards. (Normally, video cards are
  357. restarted only at system restart.) You might be able to do this by disassembling
  358. the video drivers, but perhaps the manufacturer would tell you if you asked
  359. nicely. (Incidentally, the "Toby" video cards also have an undocumented ribbon
  360. cable connector that an Apple engineer explained to me could be used to achieve
  361. hardware-level synchronization. He said it might not work. I tried, but never got
  362. it to work.) I hope you'll share any useful results with me. I'd love to learn
  363. the restart commands for other video cards, especially Apple's, and would add
  364. support for them to the VideoToolbox software.
  365.  
  366. HARDWARE: David Brainard <brainard@condor.psych.ucsb.edu> writes, "We have been
  367. working on the problem of synchronizing two video cards. For the Apple 8•24 card
  368. (rev B), we have a simple hardward solution. It turns out you can cut the clock
  369. trace and push the clock signal through a fast OR gate. Somewhat to my surprise,
  370. you can hold the clock for as long as you like without changing the state of the
  371. board.  When you release the clock, the sync is shifted by the amount of time you
  372. held the clock. The 8•24 cards are OK.  They will drive a 16" monitor and
  373. SetEntriesQuickly works fast. They cost $239 used. There may be a software
  374. solution like the one you developed for the Toby cards, but my guy struggled with
  375. it for a while and gave up. (He is better with hardware than software, which is
  376. why we went the way we did.)"
  377.     Karsten S. Weber ( karsten@john.berkeley.edu) adds, "I am working as a
  378. programmer for Professor Martin Banks at the University of California at
  379. Berkeley. We have recently done some stereo motion experiments that required
  380. synchronizing two video cards. I read in the 'Video Tool Box documentation'
  381. about how Dr. Brainard had developed a hardware solution for synchronizing two
  382. 8*24 cards. I have since used Brainard's work (and corresponded with him
  383. frequently) to do the same for our lab, but we did have some troubles with his
  384. approach primarily because we are using larger monitors. These problems have
  385. been solved in a nice way, as described below.
  386.     First I tried the approach that Brainard had successfully implemented
  387. earlier, i.e. a transistor to stop the clock of the video board. After soldering
  388. the transistor on the board, I tested it, and it worked fine. There is, however,
  389. a problem with this approach. It only works for 13" and 16" monitors. When I
  390. started using our 21" monitors, stopping the clock had no effect on the video
  391. output whatsoever! There is more than one clock on the video board, and it turns
  392. out that 21" monitors can be synchronized by stopping the fastest of the clocks.
  393. Using the 21" monitor and the 8*24 video board gives a maximum of 256 colors.
  394.     Secondly I implemented a nice software approach to synchronize the
  395. monitors. By looking at the VBLs for both boards I saw that they only stay in
  396. sync for a few seconds. This means that it is necessary to synchronize the video
  397. boards before every trial, of which there can be hundreds. It is therefore
  398. desirable to have a fast and easy way  to synchronize the boards. I came up with
  399. a way for doing the synchronization that does not require photometers and a scope
  400. (as is required in Dr. Brainard's approach). The idea is the following: The
  401. hardware modification is installed on both video boards (rather than just one). A
  402. VBL interrupt routine is written for each board. When a VBL occurs on the left
  403. video board, the left interrupt routine is activated, and this routine stops the
  404. clock for the left video board (it does this by controlling the hardware that was
  405. added on the board). This means that the video board is stopped exactly at VBL
  406. time. The same procedure is done with the right video board:  The interrupt from
  407. the right video board activated the right interrupt routine that stops the right
  408. video board. In this way both video boards get stopped at the time as their
  409. respective VBLs. The main program is still running and when it detects that both
  410. video cards have stopped, it activates them simultaneously, and the two video
  411. boards are now in synch.  This means that synchronization can be done by calling
  412. one function, and the time it takes to synchronize the video boards is less than
  413. the time between the two VBLs. I'm using DTR of the modem and printer port to
  414. control the hardware."
  415.  
  416. BB. MORE ON INTERRUPTS
  417.  
  418. Michael Bach, bach@sun1.ruf.uni-freiburg.de, writes, "We are trying to do
  419. simultaneous visual stimulation and analog measurement of brain potentials on
  420. the same Macintosh. One of our ideas was to use the Time Manager to trigger
  421. analog measurement every 2 ms in its interrupt service routine. This works fine
  422. unless we use animate palette (or GDSetEntries or GDSetGamma): No timer tasks
  423. are serviced until vbl. Apparently the video driver goes into a tight loop,
  424. polling a vbl flag, with interrupts switched off! Can this be true? This would
  425. be a strong setback for using the Mac for this sort of work." Yes, alas, the
  426. normal behavior for interrupt service routines and the driver Control calls on
  427. the Mac is to suspend all interrupts until returning. Most video card drivers
  428. wait for vbl, as Michael says. However, TrueVision's NuVista returns
  429. immediately, letting the video card processor do the work later, at vbl time.
  430. And SetEntriesQuickly.c, for the few devices that it supports, allows you to
  431. achieve whatever behavior you want. Those solutions will make your code highly
  432. dependent on the particular video card. One solution that might work on all
  433. video cards would be to only call the video driver (e.g. GDSetEnries) during
  434. vertical blanking, i.e. immediately after the vbl interrupt occurs (use
  435. VBLInstall.c).
  436.      Michael Bach (bach@sun1.ruf.uni-freiburg.de) adds, "We have since done
  437. more experiments. We have an A/D card from National Instruments (NB-MIO-16),
  438. which we use with LabView. National Instruments also provide a library of
  439. lower-level routines ("NI-DAQ"), namely one "SCAN" that regularly scans analog
  440. input and writes into a buffer in memory. As the card lacks DMA, this is --
  441. reading between the lines of their documentation -- implemented by an interrupt
  442. service routine called at the end of conversion. For this, the "NB-Handler Init"
  443. must be installed when the system is started up. While interrupts are blocked,
  444. measurements are kept in a FIFO on the card. If we use their SCAN routine,
  445. sampling is performed smoothly and not blocked by AnimatePalette et al.  But care
  446. has to be taken that the FIFO is not overrun." This confirms that the video
  447. driver blocks all interrupts. Any interrupt that's still asserted will occur when
  448. the video driver exits. The timer interrupt is asserted only briefly and is lost
  449. if not serviced promptly; apparently the A/D card's slot interrupt request
  450. remains asserted until serviced.
  451.  
  452. C. CONTROLLING THE COLOR LOOKUP TABLE (CLUT)
  453.  
  454. QuickDraw is one of the great virtues of the Macintosh. However, several of its
  455. assumptions about what you want are inappropriate for vision experiments. In
  456. particular, it assumes that you want all your monitors to act as one consistent
  457. desktop (with consistent color tables). This is a problem if you want to load
  458. completely independent lookup tables and images onto two monitors that, for
  459. example, you may want to superimpose optically. QuickDraw enforces the
  460. consistency throught the Palette Manager, but calls that are nominally to the
  461. Color Manager (e.g. Apple's SetEntries) may be intercepted by the Palette
  462. Manager, resulting in undesired effects on other screens. My solution is to
  463. bypass QuickDraw and to load the lookup tables more or less directly, without
  464. telling QuickDraw.
  465.  
  466. GDSetEntries() and SetEntriesQuickly() work outside of QuickDraw. GDSetEntries
  467. makes a cscSetEntries control call to the video driver; SetEntriesQuickly
  468. directly addresses the hardware. They both load the clut of the video card
  469. without changing the color spec table of the graphics device; QuickDraw will
  470. continue to assume that the graphics device's color spec table is a true copy of
  471. the clut. This is the behavior that I usually want. However, it may cause
  472. problems if you use CopyBits since CopyBits will translate the color of each
  473. pixel it copies, using the inverse color table of the current device, which is
  474. based on the color spec table, NOT the clut. If you want to use CopyBits or
  475. SetCPixel, you should copy your color spec table into the graphics device's color
  476. spec table, and set ctSeed to alert QuickDraw that it's been changed. Or, instead
  477. of using QuickDraw's CopyBits and SetCPixel, you could use the VideoToolbox's
  478. CopyBitsQuickly and SetPixelsQuickly(), which copy pixel walues directly,
  479. ignoring all color tables and inverse color tables.
  480.  
  481. D. HIGH FRAME RATES
  482.  
  483. On March 17 fifty of us sent a letter to Apple--see "cscSetModeTiming.doc" in the
  484. "Notes" folder--requesting a new feature for video drivers to support arbitrary
  485. frame rates and resolutions. High frame rates are particularly relevant to stereo
  486. (using LCD glasses to alternate eyes) and retinal physiology (because retinal
  487. ganglion cells respond up to 100 Hz).
  488.  
  489. For some vision experiments it is desirable to run at very high frame rates, e.g.
  490. 100 or even 200 Hz for retinal physiology experiments. There exist special
  491. monitors, e.g. the Joyce DM-4 Display, that run at such high frame rates, but no
  492. video cards automatically configure themselves to work with such odd displays.
  493. All Mac video cards that I know of are programmable to a wide range of line and
  494. frame rates, but very few video card manufacturers provide information on how to
  495. do this programming. (Normally, the video card senses the kind of monitor through
  496. the monitor sense lines and the video driver programs the card to suit the
  497. monitor. Alas, the monitor sense line scheme basically only identifies the Apple
  498. monitors, and is not a general purpose solution. The video driver is a program
  499. that is read from your video card's ROM into memory when you boot the computer.)
  500. Truevision does supply information on how to program the NuVista to arbitrary
  501. line and frame rates. (I believe the TrueVision's max frame rate is over 100 Hz,
  502. but I don't recall what the limit is.)
  503.  
  504. Apple's response has two parts. Firstly, the VideoToolbox now includes a custom
  505. version of the video driver for the PowerMac 7500/8500 (sorry it's ONLY for those
  506. two models) that supports a 120 Hz frame rate at 640x480 pixels. This custom
  507. version was created for us by Fernando Urbina, the Apple engineer who wrote the
  508. original 7500/8500 built-in-video driver. Secondly, he is trying to draft a spec
  509. to allow a general-purpose video driver call that would allow us to specify any
  510. achievable configuration of pixels and frame rates.
  511.  
  512. E. MORE-THAN-8 BIT DACs
  513.  
  514. NuBus cards:
  515. RasterOps “ProColor 32” has 9-bit DACs. 
  516. RasterOps “Paintboard Turbo XL” has 9-bit DACs. $1399 (Mentioned by Steve Shevell)
  517. Radius Thunder IV GX-1600,-1360,-1152 and Thunder/24 GT have 10-bit DACs & 185 MHz pixel clock.
  518.  
  519. Rhea Eskew, eskew@neu.edu, writes "There is a 12-bit video board now available
  520. for the Mac. It's the Psychophysics Display Interface, from Australia. I have the
  521. generation 2 version, and Charles Stromeyer has purchased generation 3, which is
  522. now in my lab (but hasn't yet really been tested).  In addition to 12-bit dacs it
  523. has some nice hardware features, like configurable color lookup tables and 2
  524. frame buffers (you can allegedly make one image a function of another, like for
  525. windowing etc -- but I haven't tried it yet).  The drawbacks are the cost (I
  526. don't know how much he'll charge now, but it's at least 8X the cost of a standard
  527. board) and the fact that the maker is small, in Australia, and has had trouble
  528. delivering new products according to schedule (he has been prompt and helpful
  529. about solving problems after delivery, however)".
  530. James Sokoll Pty Ltd
  531. PO Box 808 
  532. Kenmore  4069 AUSTRALIA
  533. Tel: 617 878 3357
  534. Fax: 617 378 9794
  535.  
  536. Does anyone know of any others?
  537.  
  538. F. SHIELDCURSOR
  539.  
  540. In the summer of '93 Steve Lemke at Radius (lemke@radius.com) wrote, "Apple has
  541. stated several times (though I wouldn't necessarily expect you to have run across
  542. any of them) that if you write directly to the screen, you must use the
  543. "ShieldCursor" and "ShowCursor" traps to prevent the cursor from being
  544. overwritten.  To do so, you pass the rectangle in which you are drawing to
  545. "ShieldCursor". It's nice that all QuickDraw routines use this trap, as it makes
  546. for a simple way to identify what areas of the screen are changing. It also makes
  547. for a simple way for people who draw directly to the screen to notify the Radius
  548. PowerView software that they are doing so.  Everything in that rectangle gets
  549. updated on the Radius PowerView screen.  Too bad more programs don't use it,
  550. though..."
  551.  
  552. Taking his advice, CopyWindows calls ShieldCursor before calling
  553. CopyBitsQuickly.
  554.  
  555. G. DISASSEMBLING A VIDEO DRIVER
  556.  
  557. Assuming you can read 680x0 assembly code, use the VideoToolbox utility
  558. GrabVideoDrivers to put the driver into a file, then use ResEdit with the
  559. ResEdit CODE editor to examine it, comparing it with the example in the
  560. appendix of Apple's Designing Cards and Drivers book. The ResEdit CODE editor is
  561. a public domain file distributed by:
  562. Ira L. Ruben
  563. Apple Computer, Ioc.
  564. 20525 Mariani Ave., MS: 37-A
  565. Cupertino, Ca. 95014
  566. Ira@apple.com
  567. ftp.apple.com:/dts/mac/tools/resedit/resedit-2-1-code-editor...
  568.  
  569. H. FIXING THE MAC IIci BUILT-IN VIDEO DRIVER
  570.  
  571. (The following remedies worked for the Mac IIci video driver, patching or
  572. replacing the buggy version 0 .Display_Video_Apple_RBV1 driver by copying the
  573. bug-free version 1 of the same driver from the Mac IIsi. It is very likely that
  574. an analogous approach could be used to patch or replace the buggy version 0, 1,
  575. and 2 .Display_Video_Apple_DAFB drivers in the Quadra 700, 750, and 900, by the
  576. bug-free version 3 or 5 of that driver in the Centris 650 or LC 475.)
  577.  
  578. The Mac IIci built-in video driver (.Display_Video_Apple_RBV1 driver, version 0)
  579. has a bug that causes it to crash if you try to do a cscGetEntries Status
  580. request. Here are two ways to fix the bug:
  581.  
  582. 1. AUTOMATIC TEMPORARY PATCH. (This happens automatically if you use GDVideo.
  583. This note is an explanation, in case you're curious.) The bug only affects
  584. GDGetEntries, so the first time GDGetEntries is invoked it automatically calls
  585. PatchMacIIciVideoDriver() in GDVideo.c to find and patch the copy of the buggy
  586. driver residing in memory, preventing any trouble. (If the driver is in ROM, then
  587. the driver is copied to RAM, and patched there.) Only two instructions are
  588. modified, to save & restore more registers. (I figured out what needed patching
  589. by comparing this driver's disassembly with the bug-free version in the Mac
  590. IIsi.) And the driver's version number is changed from 0 to 100, so that programs
  591. can distinguish it from the buggy version 0. This fix persists only until the
  592. next reboot.
  593.  
  594. 2. PERMANENT UPGRADE. The Mac IIsi has version 1 of the same driver, without
  595. the bug. In principle all you have to do is copy the new driver from the IIsi
  596. to your IIci, but this is nontrivial because these drivers are in ROM. It is
  597. fairly simple, as described below, to place a copy of the version 1 (i.e.
  598. fixed) driver into the System file of the Mac IIci, but, as explained in Inside
  599. Mac V-424, this will only displace the older version 0 (buggy) driver if it's
  600. not driving the boot monitor (i.e. if the "Welcome to Macintosh" message
  601. appears on some other monitor), because the boot monitor's driver is loaded at
  602. boot time before the System file is available. If you have multiple monitors,
  603. you can use the Monitors Control Panel to change the boot monitor: hold the
  604. option key down and drag the smiling Mac to any monitor except the one driven
  605. by the built-in video. So, in case you do have multiple monitors, here's how to
  606. copy the driver. First put the VideoToolbox utility "GetVideoDrivers" on a
  607. floppy and run it on a Mac IIsi. That will copy the all the video drivers onto
  608. your floppy as ResEdit files. Then put the floppy in your Mac IIci and copy
  609. "-Display_Video_Apple_RBV1" onto your hard disk. Make a copy of your System
  610. file. Open the "-Display_Video_Apple_RBV1" file in ResEdit. Hit Command-I to
  611. edit the Resource Info. Set the "System Heap" and "Purgeable" flags, change the
  612. ID from 1 to 122, and close the Resource Info window. Now copy the resource and
  613. paste it into the copy of your System file. Quit, saving changes. Now rename
  614. the active System file to something else, like "old System", and rename the
  615. edited System file to "System". Reboot. You can now throw the old System into
  616. the trash. The new driver will automatically be favored over the one in ROM
  617. because it has a higher version number (1 instead of 0). All my test programs
  618. indicate that the new driver works fine in the Mac IIci with System 7, and I
  619. would expect it to work fine with System 6 as well. (Thanks to
  620. Mike.Alexander@um.cc.umich.edu for figuring out why it didn't work for the boot
  621. monitor.)
  622.  
  623. I. VIDEO BANDWIDTH
  624. Paul Sowden, pss2ps@surrey.ac.uk, asks, "We have built a video attenuator for
  625. use with a PC based system and are now at the stage of calibrating our
  626. attenuator. Prior to this we need to check the input impedance of our monitor
  627. at various frequencies in the manner you describe in your paper (Vis. Res. 31,
  628. 1337-1350). In your paper you state that Z (the monitor's input impedance)
  629. should be independent of the oscillator frequency, from d.c. to 20 MHz. Our
  630. query is where does the upper limit of 20 MHz come from?" Sorry, the paper
  631. should have spelled it out. Your monitor draws pixels one after another along
  632. each scan line as it paints your image on the screen. The clock rate of the
  633. pixels depends on your video card. 20 MHz was common at the time the paper was
  634. written (e.g. a 640x480x67 Hz display) but higher speeds, e.g. 100 MHz, are
  635. common now. If you think about the spatial frequency spectrum of a scan line,
  636. it corresponds to the temporal frequency spectrum of the video signal for that
  637. line, where the width of the screen (e.g. in degrees of arc at the viewer's
  638. eye) corresponds to the time for the line to sweep across the screen. The time
  639. for a line is approximately the reciprocal of the line rate (except for a small
  640. blanking interval), which is typically around 34 kHz. (Alternatively, and
  641. equivalently, you can establish the correspondence based on a pixel's width and
  642. its duration, which is the reciprocal of the pixel clock rate.) If the pixel
  643. clock rate is f, then a scan line can represent image frequencies up to f/2 (by
  644. the Nyquist sampling theorem), and you would want the monitor's input impedance
  645. to be constant up to at least that frequency. In practice the only way of
  646. achieving this is to design a high-input-impedance amplifier with a 75 ohm
  647. resistor at its input. That gives the desired fixed impedance over a very wide
  648. bandwidth. So, in practice you'll probably find that your monitor's input
  649. impedance is either terribly frequency dependent (and unfit for serious
  650. psychophysical work) or fine over a very wide bandwidth. A separate issue is
  651. that it is desirable for the video bandwidth of the monitor to be as high as
  652. possible, to follow the frequencies in the incoming video signal, to avoiding
  653. nonlinear distortions from slew rate limitations, as discussed in the paper.
  654.  
  655. VIDEO BUGS
  656.  
  657. Other than reading and writing pixels, all access to a video device normally
  658. goes through the software video driver. (You can use VideoToolbox
  659. SetEntriesQuickly.c to bypass the video driver of a few devices, but I don't
  660. recommend that, except as a last resort, because your program will then only
  661. work with the few video devices that SetEntriesQuickly supports.) The video
  662. driver is normally supplied in ROM on the video card or, for built-in video, in
  663. the computer's ROM. (Apparently, new PCI drivers can simply be tossed onto the
  664. System Folder.) Many drivers have subtle bugs that TimeVideo has uncovered and
  665. documented. This file is a complete list of all the bugs that I know of. I have
  666. the very strong impression that reporting these bugs to the manufacturers has
  667. led them to eliminate the bugs in subsequent versions. Before TimeVideo there
  668. was no easy way to test for most of these bugs. If your driver is not listed,
  669. please run TimeVideo and send me the report: denis@psych.nyu.edu
  670.  
  671. 1. The following drivers crash if one attempts to make a cscGetEntries request. 
  672. GDGetEntries tests for these driver names and version numbers, and returns an
  673. error message instead of calling a driver that would crash. Try the demo
  674. TestGDVideo.
  675. •Mac IIci “Macintosh II Built-In Video” (.Display_Video_Apple_RBV1) (Reported
  676. to Apple MacDTS 3/7/90 and Apple.Bugs 12/30/92)
  677. •Relax 19" Model 200 (.Color_Video_Display version 9288). (Reported to Relax
  678. Tech. 1/19/93)
  679. •DOME MD Max (.Display_Video_Apple_DOMEMax version 2). (Reported to DOME
  680. 3/30/95.)
  681.  
  682. 2. The following drivers either take too long (more than 1 frame) to load the
  683. clut (i.e.  cscSetEntries), or suppress one or more frame's worth of VBL
  684. interrupts each time they load the clut, or both. Try TimeVideo.
  685. •Apple Power Macintosh 8500/120 (.Display_Video_Apple_Control) each call to
  686. cscSetEntries suppresses 1 vbl interrupt.
  687. •Apple 4•8 and 8•24 “Macintosh Display Card” (.Display_Video_Apple_MDC) and
  688. “Macintosh Display Card 8•24 GC” (.Display_Video_Apple_MDCGC) take two frames
  689. to load the clut (and suppress one vbl interrupt) in all modes. (Reported to
  690. Apple.Bugs 12/30/92)
  691. •Radius PrecisionColor 8  and 8xj take 5-8 frames to load the whole clut in
  692. 8-bit mode (and suppress 5-8 vbl interrupts); the time is proportional to the
  693. number of clut entries being loaded. (Ok in 1-, 2-, and 4-bit modes.)
  694. •“RasterOps ColorBoard 264” (.RasterOps 1.2 264   Video Driver version 9327)
  695. takes 2 frames to load the clut (and suppresses 1 vbl interrupt) in 8- and
  696. 32-bit modes. (Ok in 1-, 2-, and 4-bit modes.)
  697. •RasterOps  “PaintBoard Li” 1.0 24XLi Video Driver takes 4 frames to load the
  698. clut (and suppresses 3 vbl interrupts)  in 8-,16-, and 32-bit modes. (Ok in
  699. 1-,2-, and 4-bit modes.) (Reported to RasterOps 12/30/92).
  700. •“RasterOps 8XL” (.RasterOps 1.2 8XL Video Driver version 9327) takes 4 frames
  701. to load the clut (and suppresses 3 vbl interrupts) in 8-bit mode. (Ok in 1-,2-,
  702. and 4-bit modes.)
  703. •"RasterOps 24XLTV" (.RasterOps 1.4 24XLTV Video Driver version 9327) takes 4
  704. frames to load the clut (and suppresses 3 vbl interrupts) in 8- and 32-bit
  705. modes. (Ok in 1-,2-, 4-, and 16-bit modes.)
  706. •RasterOps "PaintBoard Turbo XL" (.RasterOps 1.0 PBTurboXL Video Driver version
  707. 9327) takes 4 frames to load the clut (and suppresses 3 vbl interrupts).
  708. •“Spectrum/8•24 PDQ” (.Display_Video_Apple_SpecRice version 3) takes 4 frames
  709. to load the clut in all modes.
  710.  
  711. 3. The following cards and drivers issue multiple VBL interrupts per frame,
  712. whereas they should emit exactly one per frame. Try TimeVideo.
  713. •The 4•8 and 8•24 “Macintosh Display Card” (.Display_Video_Apple_MDC) emit
  714. several VBL interrupts per video frame. (Reported to Apple.Bugs 12/30/92)
  715. •Apple Quadra 700 "Macintosh E Built-In Video" (.Display_Video_Apple_DAFB)
  716. emits 2 VBL interrupts per frame if the processor cache is enabled, but emits
  717. only 1, as it's supposed to, if the processor cache is disabled. (Reported by
  718. Kyle Cave, cavekr@ctrvax.vanderbilt.edu)
  719. •Apple Quadra 900 “Macintosh C Built-In Video” (.Display_Video_Apple_DAFB)
  720. occasionally emits more than 1 VBL interrupt per frame. 
  721. •Apple Quadra 950 “Macintosh G Built-In Video” (.Display_Video_Apple_DAFB
  722. version 2)  emits 2 or 3 VBL interrupts per frame. (Reported to Apple.Bugs
  723. 12/30/92)
  724. •Note that the .Display_Video_Apple_DAFB version 3 driver does NOT exhibit this
  725. bug, at least on the Centris 650 where it resides. It would be interesting to
  726. try copying this driver to the afflicted Quadra's, adapting the instructions
  727. given above for copying a driver from the IIsi to the IIci.
  728.  
  729. 4. 16 & 32-bit modes. These video drivers will correctly load the whole clut,
  730. but screw up if asked to load one clut entry at a time. The problems only occur
  731. in 16- and 32-bit mode, i.e. calling cscDirectSetEntries. Apparently few or no
  732. applications (other than TimeVideo) ever do this, as otherwise the
  733. manufacturers would have detected the fault.
  734. •TrueVision NuVista version 3.0 cscDirectSetEntries (i.e. 16- and 32-bit pixel
  735. modes) loads garbage unless “start” is zero. cscSetEntries (i.e. 1-, 2-, 4-,
  736. and 8-bit pixel modes) works fine. 
  737. •RasterOps "PaintBoard Turbo XL" (.RasterOps 1.0 PBTurboXL Video Driver version
  738. 9327) crashes when attempting to serially load the CLUT in 16-bit mode.
  739.  
  740. 5. The following video drivers don't support cscSetGamma or cscGetGamma.
  741. (Apparently Apple considers these calls are optional, so not supporting them is
  742. not, strictly speaking, a bug.)
  743. •“Radius PowerView” (.Radius PowerView Display version 9848) calling
  744. cscGetGamma returns a gamma table that's all zero. Calling cscSetGamma has no
  745. effect. Fortunately the permanent gamma table is the identity transformation.
  746. (Radius confirmed the bugs on 7/93.)
  747. •“Radius GS/C” (.Radius GSC version 18663) doesn't support cscSetGamma or
  748. cscGetGamma. Unfortunately the permanent gamma table is NOT the identity
  749. transformation, so it fails the write-then-read cscSetEntries-cscGetEntries
  750. test performed by TimeVideo. (Radius suggests upgrading to one of their newer
  751. cards. 3/95)
  752. •“SuperMac ColorCard” v1.97S (.Display_SuperMac_ColorCard version 1) does not
  753. implement the gamma table; cscSetGamma and cscGetGamma both return error codes.
  754. Fortunately the permanent gamma table is the identity transformation. 
  755.  
  756. 6. Some color video cards autodetect monochrome monitors, and remain in gray
  757. mode despite attempts to set to color mode (e.g. to use the ISR Video
  758. Attenuator). You may be able to fool the video card into thinking it's driving
  759. a color monitor by using a MacLiberty adapter [cheap--ordering address appears
  760. in "Advice"] to program the sense pins appropriately.
  761. •If the “Radius PrecisionColor 8” and “Radius PrecisionColor 8Xj” sense a
  762. monochrome monitor then they always operate in "gray" mode, even though the
  763. driver allows you to set and read the color/gray bit. Try TimeVideo.
  764. •Tom Busey asks, "I have an apple 2-page monochrome monitor, and I'd like to
  765. use an ISR Video Attenuator with it [see VideoToolbox:ISR Video Attenuator].
  766. The problem is that my PowerMac 7100 vram port insists that the 2-page monitor
  767. is grayscale only, i.e. TimeVideo reports !color. Is there any way to trick the
  768. card into thinking it is in color so that I can use my video attenuator?" A few
  769. weeks later, he adds, “The MacLiberty adapter does fool the computer into
  770. thinking I’ve got a color monitor. However, the monitor has an unusual
  771. connector and takes its input from the blue instead of the green video pin, so
  772. I'm making a custom  video attenuator with its output on that pin.”
  773.  
  774. 7. Other bugs:
  775. •“DOME Md Imaging Card” (.Display_Video_Apple_DOMEMd version 2) calling
  776. cscGetEntries returns RRR instead of RGB. (Patrick Flanagan reported it to DOME
  777. on 3/29/95.)
  778. •“Spectrum/8•24 PDQ” (.Display_Video_Apple_SpecRice version 3) failed all
  779. cscGetEntries tests when in 16-bit-pixel mode.
  780. •“Truevision NuVista+™ Card” (.Display_Video_NuVista version ??) fails all
  781. cscGetEntries tests. Reported by David Rose <PSY009@sysh.surrey.ac.uk> on 8/94.
  782. •Relax 19" Model 200 (.Color_Video_Display version 9288) doesn't support the
  783. optional cscGetGamma Status call. The required cscGetPageCnt (aka cscGetPages)
  784. Status call erroneously returns a page count of 0 for all modes. Try TimeVideo
  785. or TestGDVideo. (Reported to Relax Tech. 1/19/93)
  786. •TrueVision NuVista version 3.0 can't display MacsBug.
  787. •The presence of the 8•24GC accelerator seems to HALVE the speed of CopyBits,
  788. at least on a RasterOps 8XL running on a Mac IIfx. CopyBitsQuickly is
  789. unaffected, of course.
  790. •Apple PowerBook 520/540 "CSC-2 Built-In Video" (.Display_Video_Apple_CSC
  791. version 4) apparently makes small 1-2% errors in the write-then-read
  792. cscSetEntries-cscGetEntries CLUT test performed by TimeVideo. (Perhaps it
  793. doesn't support cscSetGamma.)
  794.  
  795. 6. Video drivers that have been tested (v.0, unless noted otherwise):
  796. Apple “Toby frame buffer card” (.Display_Video_Apple_TFB v.4,5,& 6)
  797. Apple “Mac II High-Resolution Video Card” (.Display_Video_Apple_HRVC)
  798. Apple 8•24 “Macintosh Display Card” (.Display_Video_Apple_MDC)
  799. Apple “Macintosh Display Card 8•24 GC” (.Display_Video_Apple_MDCGC)
  800. Apple Mac Plus “1-bit QuickDraw”
  801. Apple Mac SE “1-bit QuickDraw”
  802. Apple Mac Portable “1-bit QuickDraw”
  803. Apple Mac Centris 610 “Macintosh I Built-In Video” (.Display_Video_Apple_DAFB v.3)
  804. Apple Mac Centris 650 “Macintosh I Built-In Video” (.Display_Video_Apple_DAFB v.3)
  805. Apple Mac Centris 660AV “Macintosh 3B” (.Display_Video_Apple_Civic)
  806. Apple Mac Classic II “Macintosh F Built-In Video” (.Display_Video_Apple_Apollo)
  807. Apple Macintosh LC III “Macintosh AA Built-In Video” (.Display_Video_Apple_Sonora)
  808. Apple “Macintosh SE/30 Internal Video” (.Display_Video_Apple_MacSE/30 Video)
  809. Apple Mac IIci “Macintosh II Built-In Video” (.Dksplay_Video_Apple_RBV1 v.0&1)
  810. Apple Mac IIsi “Macintosh A Built-In Video” (.Display_Video_Apple_RBV1 v.1)
  811. Apple Mac LC II “Macintosh B Built-In Video” (.Display_Video_Apple_V8)
  812. Apple Mac LC 475 “MEMCjr Built-In Video” (.Display_Video_Apple_DAFB v.5)
  813. Apple PowerBook 160 “Macintosh J Built-In Video”(.Display_Video_Apple_DBLite v.1)
  814. Apple PowerBook 160 “Macintosh A External Video”(.Display_Video_Apple_ViSC)
  815. Apple PowerBook 170 “Macintosh D Built-In Video” (.Display_Video_Apple_TIM)
  816. Apple PowerBook 180 “Macintosh A External Video” (.Display_Video_Apple_ViSC)
  817. Apple PowerBook 180 “Macintosh J Built-In Video” (.Display_Video_Apple_DBLite v.1)
  818. Apple PowerBook 520/540 "CSC-2 Built-In Video" (.Display_Video_Apple_CSC v.4)
  819. Apple Power Macintosh 6100/60 "Built-In VRAM Video"
  820. Apple Power Macintosh 6100/60 "Built-In DRAM Video" (.Display_Video_Apple_Sonora v.3)
  821. Apple Power Macintosh 6100/60av "Built-In AV Video" (.Display_Video_Apple_Civic v.1)
  822. Apple Power Macintosh 7100/66 "Built-In VRAM Video" (.Display_Video_Apple_HPV_PDS v.1)
  823. Apple Power Macintosh 7100/66 "Built-In DRAM Video" (.Display_Video_Apple_Sonora v.3)
  824. Apple Power Macintosh 8100/80 "Built-In AV Video" (.Display_Video_Apple_Civic v.1)
  825. Apple Power Macintosh 8100/80 "Built-In VRAM Video" (.Display_Video_Apple_HPV_PDS v.1)
  826. Apple Power Macintosh 8100/80 "Built-In DRAM Video" (.Display_Video_Apple_Sonora v.2)
  827. Apple Power Macintosh 7200 (.Display_Video_Apple_Platinum)
  828. Apple Power Macintosh 8500/120 (.Display_Video_Apple_Control)
  829. Apple Quadra 630 "Valkyrie Built-In Video" (.Display_Video_Apple_Valkyrie)
  830. Apple Quadra 660AV "Macintosh 3B" (.Display_Video_Apple_Civic)
  831. Apple Quadra 700 “Macintosh E Built-In Video” (.Display_Video_Apple_DAFB)
  832. Apple Quadra 840AV “Macintosh 3A” (.Display_Video_Apple_Civic v.0&2)
  833. Apple Quadra 900 "Macintosh C Built-In Video" (.Display_Video_Apple_DAFB)
  834. Apple Quadra 950 “Macintosh G Built-In Video” (.Display_Video_Apple_DAFB v.1&2)
  835. Apple WS 6150/66 “Built-In DRAM Video” (.Display_Video_Apple_Sonora v.4)
  836. “DOME Md Imaging Card” (.Display_Video_Apple_DOMEMd v.2)
  837. DOME MD Max "Vortech" (.Display_Video_Apple_DOMEMax v.2)
  838. Ehman “15" Full Page Video Card...”(.Lapis DisplayServerT II Rev 1.0)
  839. E-Machines "ColorLink_ SX-T" (.Display_Video_Apple_EM_10T v.5376)
  840. Lapis “Dual Page Video 1024x768” (.Lapis DisplayServer™ II Rev 1.0)
  841. “Radius GS/C” (.Radius GSC v.18663)
  842. “Radius PowerView” (.Radius PowerView Display v.9848)
  843. Radius PrecisionColor 8 (.Radius PrecisionColor 8)
  844. “Radius PrecisionColor 8Xj” (.Radius PrecisionColor 8Xj)
  845. “RasterOps ColorBoard 264” (.RasterOps 1.2 264   Video Driver v.9327)
  846. RasterOps “PaintBoard Li” (.RasterOps 1.0 24XLi Video Driver v.9327)
  847. RasterOps “ProColor 32” (.RasterOps 1.0 32XL Video Driver v.9327)
  848. “RasterOps 8XL” (.RasterOps 1.2 8XL Video Driver v.9327)
  849. RasterOps 24 L (.RasterOps 1.0 24 L Video Driver)
  850. "RasterOps 24XLTV" (.RasterOps 1.4 24XLTV Video Driver v.9327)
  851. RasterOps "PaintBoard Turbo XL" (.RasterOps 1.0 PBTurboXL Video Driver v.9327)
  852. “Relax 19" Model 200” (.Color_Video_Display v.9288)
  853. “Spectrum/8•24 PDQ” (.Display_Video_Apple_SpecRice v.3)
  854. “SuperMac ColorCard” v1.97S (.Display_SuperMac_ColorCard v.1)
  855. “Truevision NuVista™ Card” (.Display_Video_NuVista v.3.0)
  856. “Truevision NuVista+™ Card” (.Display_Video_NuVista v.??)
  857.  
  858. CONTRIBUTORS TO THIS DOCUMENT
  859. Ken Alexander, kennalex@uic.edu, E-Machines "ColorLink_ SX-T", PowerMac 8500
  860. Mike Alexander, Mike.Alexander@um.cc.umich.edu, RasterOps ColorBoard 264, why you can't replace boot monitor’s driver.
  861. Michael Bach, bach@sun1.ruf.uni-freiburg.de, more on interrupts.
  862. David Brainard, brainard@condor.psych.ucsb.edu, Quadra 900, 8•24GC, RasterOps 24XLTV, RasterOps PaintBoard Turbo XL, PowerBook 520/540, synching cards.
  863. Tom Busey, busey@indiana.edu, RasterOps 8XL, Power Mac 8100/80, 7200/90, SuperMac ColorCard, Apple 2-page monochrome monitor, effect of 8•24GC "accel".
  864. Kyle Cave, cavekr@ctrvax.vanderbilt.edu, Ehman 15", Quadra 700.
  865. Raynald Comtois, raco@burrhus.harvard.edu, multiple interrupts per frame.
  866. Michael Eckert, meckert@ee.uts.edu.au, PowerMac 7100 timing & NuBus bug.
  867. Kaan Erdener, kerdener@ptnext.pitzer.edu, Quadra 660AV.
  868. Rhea Eskew, eskew@neu.edu, Psychophysics Display Interface.
  869. Bart Farell, bart_farell@isr.syr.edu, Quadra 840av, color cycling.
  870. Patrick Flanagan, flanagan@deakin.edu.au, DOME Md Imaging Card, Radius GS/C
  871. Mike Garver, Lapis Dual Page Video, Spectrum/8•24 PDQ.
  872. Tony Hayes, PowerBook 180.
  873. Gregory Jackson, zu02203@uabdpo.dpo.uab.edu, DOME Md Max video card.
  874. Richard Kunert, rkunert@facstaff.wisc.edu, PowerMac 7500,8500,9500.
  875. Sergei Kurkin, Kurkin@med.hokudai.ac.jp, GDSetPageDrawn and GDSetPageShown
  876. Steve Lemke, lemke@radius.com, ShieldCursor.
  877. Jan Linder, Jannl@aol.com, Quadra 630.
  878. Jan-Eric Litton, janel@neuro.ks.se, PowerMac 8100/80
  879. Brian McElree, bdm@psych.nyu.edu, PowerMac 9500
  880. David Rose, PSY009@sysh.surrey.ac.uk, TrueVision NuVista+, Mac LC II.
  881. Ariel Salomon, asalomon@joemama.mit.edu, Centris 610
  882. Dan Sears, sears@netcom.com, System 7.5.1, Apple Power Macintosh 6100/60av.
  883. Steve Shevell, shevell@uchicago.edu: RasterOps “Paintboard Turbo XL”.
  884. Paul Sowden, pss2ps@surrey.ac.uk, video bandwidth.
  885. Scott Stevenson, stevenso@garnet.berkeley.edu, Power Macintosh 8100/80.
  886. Fernando Urbina, nano@apple.com, PowerMac 7500, 8500.
  887. Marty Wachter, mrw@welchgate.welch.jhu.edu, Quadra 840AV.
  888. Beau Watson, beau@vision.arc.nasa.gov, 9500 w Radius Thunder 30/1600 PCI video card.
  889. Karsten Weber, karsten@john.berkeley.edu, synching two cards
  890. Wei Xie, U25384@UICVM.uic.edu, E-Machines "ColorLink_ SX-T", bug in SetEntriesQuickly for Apple 8•24 in Quadra 840AV.
  891.  
  892. Please send any corrections or additions to denis@psych.nyu.edu
  893.